package org.jeecg.modules.act.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.act.entity.ActUserRecord;
import org.jeecg.modules.act.mapper.ActUserRecordMapper;
import org.jeecg.modules.act.service.IActUserRecordService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;

/**
 * @Description: 报名记录表
 * @Author: jeecg-boot
 * @Date: 2019-09-05
 * @Version: V1.0
 */
@Service
public class ActUserRecordServiceImpl extends ServiceImpl<ActUserRecordMapper, ActUserRecord> implements IActUserRecordService {

    @Resource
    private ActUserRecordMapper recordMapper;

    @Override
    public void updateByActIdAndUserId(ActUserRecord record) {
        QueryWrapper<ActUserRecord> userRecordQueryWrapper = new QueryWrapper<>(new ActUserRecord());
        userRecordQueryWrapper.eq("user_id", record.getUserId());
        userRecordQueryWrapper.eq("act_id", record.getActId());
        recordMapper.update(record, userRecordQueryWrapper);
    }
}
